package com.sgb.kjwl.model.entity.self;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.sgb.kjwl.utils.NumberUtil;

/**
 * Describe:
 * Author:  yangLei
 * Date:    2021/4/12
 */
public class TruckApplyEntity {
    //车主userNo
    private String userNo;
    //车主姓名
    private String name;
    //车主电话
    private String telphone;
    //车牌号
    private String carNumber;
    //发货地市
    private String cityName;
    //发货地区
    private String districtName;
    //目的地市
    private String destCityName;
    //目的地区
    private String destDistrictName;
    //总运程
    private String totalDistance;
    //货物类型
    private String goodsTypeName;
    //重量
    private String weight;
    //体积
    private String volume;
    //货源信息费
    private String sourceMessagePrice;
    //货源总运费
    private String sourceAllFreight;
    //报价总运费
    private String allFreight;
    //车型
    private String carTypeName;
    //车长
    private String carLenName;
    //报价时间
    private Long createTime;
    // 订单状态 0待司机付款 1待货主确认  2待司机发车 3运输中 4已完成 5已取消 6待货主支付
    private Integer status;
    //报价状态：1已报价  2报价已同意  5报价未同意
    private Integer offerStatus;

    //报价类型 ：1 企业 2 团队 3 个人
    private String offerType;
    //团队名称
    private String teamName;
    //团队no
    private String teamNo;
    //企业名称
    private String companyName;
    //企业no
    private String companyNo;
    //报价 单价
    private String freight;
    //货源 单价
    private String sourceFreight;
    //货源 单价单位
    private Integer freightUnit;
    private Integer freightType;//运费选项 0一口价 1电议
    private Integer failureCause;

    //报价运费单位 1：元/趟，2：元/吨，3：元/方")
    private Integer quotationfreightUnit;

    public String getQuotationfreightUnit() {
        if (quotationfreightUnit == null) {
            return "元/吨";
        }
        if (quotationfreightUnit == 3) {
            return "元/方" + (TextUtils.isEmpty(volume) ? "" : " x " + NumberUtil.trim0(volume));
        } else if (quotationfreightUnit == 1) {
            return "元/趟 x 1";
        } else if (quotationfreightUnit == 2) {
            return "元/吨" + (TextUtils.isEmpty(weight) ? "" : " x " + NumberUtil.trim0(weight));
        } else
            return "元/吨";
    }

    public void setQuotationfreightUnit(Integer quotationfreightUnit) {
        this.quotationfreightUnit = quotationfreightUnit;
    }

    //报名no
    @SerializedName(value = "no", alternate = {"goodsOfferNo"})
    private String goodsOfferNo;
    private Integer pattern;
    private String secondGoodsTypeName;//2.1.4新增 二级货物类型。

    public String getOfferType() {
        return offerType;
    }

    public void setOfferType(String offerType) {
        this.offerType = offerType;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public String getTeamNo() {
        return teamNo;
    }

    public void setTeamNo(String teamNo) {
        this.teamNo = teamNo;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public String getFreight() {
        return freight;
    }

    public void setFreight(String freight) {
        this.freight = freight;
    }

    public String getSourceFreight() {
        return sourceFreight;
    }

    public void setSourceFreight(String sourceFreight) {
        this.sourceFreight = sourceFreight;
    }

    public String getFreightUnit() {
        if (freightUnit == null) {
            return "元/吨";
        }
        if (freightUnit == 3) {
            return "元/方";
        } else {
            return "元/吨";
        }
    }

    public void setFreightUnit(Integer freightUnit) {
        this.freightUnit = freightUnit;
    }

    public String getGoodsOfferNo() {
        return goodsOfferNo;
    }

    public void setGoodsOfferNo(String goodsOfferNo) {
        this.goodsOfferNo = goodsOfferNo;
    }

    public String getUserNo() {
        return userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelphone() {
        return telphone;
    }

    public void setTelphone(String telphone) {
        this.telphone = telphone;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDistrictName() {
        return districtName;
    }

    public void setDistrictName(String districtName) {
        this.districtName = districtName;
    }

    public String getDestCityName() {
        return destCityName;
    }

    public void setDestCityName(String destCityName) {
        this.destCityName = destCityName;
    }

    public String getDestDistrictName() {
        return destDistrictName;
    }

    public void setDestDistrictName(String destDistrictName) {
        this.destDistrictName = destDistrictName;
    }

    public String getTotalDistance() {
        return totalDistance;
    }

    public void setTotalDistance(String totalDistance) {
        this.totalDistance = totalDistance;
    }

    public String getGoodsTypeName() {
        return goodsTypeName;
    }

    public void setGoodsTypeName(String goodsTypeName) {
        this.goodsTypeName = goodsTypeName;
    }

    public String getWeight() {
        return weight;
    }

    public void setWeight(String weight) {
        this.weight = weight;
    }

    public String getVolume() {
        return volume;
    }

    public void setVolume(String volume) {
        this.volume = volume;
    }

    public String getSourceMessagePrice() {
        return sourceMessagePrice;
    }

    public void setSourceMessagePrice(String sourceMessagePrice) {
        this.sourceMessagePrice = sourceMessagePrice;
    }

    public String getSourceAllFreight() {
        return sourceAllFreight;
    }

    public void setSourceAllFreight(String sourceAllFreight) {
        this.sourceAllFreight = sourceAllFreight;
    }

    public Integer getFailureCause() {
        return failureCause;
    }

    public String getFailureCauseWorlds() {
        String failureCausew = "";
        if (failureCause == null)
            failureCausew = "";
        if (failureCause == 0) {
            failureCausew = "车主超时未支付信息费";
        } else if (failureCause == 1) {
            failureCausew = " 货主未同意报价";
        } else if (failureCause == 2) {
            failureCausew = "货主已下架货源";
        } else if (failureCause == 3) {
            failureCausew = "货主已删除货源";
        }
        return failureCausew;
    }

    public void setFailureCause(Integer failureCause) {
        this.failureCause = failureCause;
    }

    public String getAllFreight() {
        return allFreight;
    }

    public void setAllFreight(String allFreight) {
        this.allFreight = allFreight;
    }

    public String getCarTypeName() {
        return carTypeName;
    }

    public void setCarTypeName(String carTypeName) {
        this.carTypeName = carTypeName;
    }

    public String getCarLenName() {
        return carLenName;
    }

    public void setCarLenName(String carLenName) {
        this.carLenName = carLenName;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getOfferStatus() {
        return offerStatus;
    }

    public void setOfferStatus(Integer offerStatus) {
        this.offerStatus = offerStatus;
    }

    public Integer getFreightType() {
        return freightType;
    }

    public void setFreightType(Integer freightType) {
        this.freightType = freightType;
    }

    public Integer getPattern() {
        return pattern;
    }

    public void setPattern(Integer pattern) {
        this.pattern = pattern;
    }

    public String getSecondGoodsTypeName() {
        return secondGoodsTypeName;
    }

    public void setSecondGoodsTypeName(String secondGoodsTypeName) {
        this.secondGoodsTypeName = secondGoodsTypeName;
    }
}
